package com.eternal.base.database.entity;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
 * Created by Administrator
 * On 2020/4/26
 * Description:
 * @author Administrator
 */
@Entity(primaryKeys = {"mac", "id", "type", "port"})
public class Notification {
    @NonNull
    public String mac;
    public int id;
    public String name;
    public boolean open;
    public byte type;
    public byte model;
    public byte tmpHum;
    public char start;
    public char end;
    public char cycleOn;
    public char cycleOff;
    public byte hTmpC;
    public byte lTmpC;
    public byte hTmpF;
    public byte lTmpF;
    public byte hHum;
    public byte lHum;
    @ColumnInfo(defaultValue = "0")
    public byte port;

    @Override
    public boolean equals(@Nullable Object obj) {
        if(obj instanceof Notification){
            Notification other= (Notification) obj;
            return mac.equals(other.mac) && id == other.id && type == other.type;
        }
        return false;
    }
}
